import 'package:get/get.dart';
import 'package:safetymonitor/app/core/http/http.dart';
import 'package:safetymonitor/app/core/utils/interface.dart';
import 'package:safetymonitor/app/data/entities/application/risk_img_entity.dart';

class SnapShotHistoryController extends GetxController {
  /// 获取列表数据
  Future<List<RiskImgEntity>> getData(int pageNum, int pageSize, {String? search}) async {
    // 获取流程模板接口
    final res = await HttpUtil().generatePostRequest<List<RiskImgEntity>>(Interface.getRiskImgPage, data: {
      'pageNo': pageNum,
      'pageSize': pageSize,
    }).execute();

    List<RiskImgEntity>? data;
    res.onSuccess((result) {
      data = result.data;
    });
    return data ?? [];
  }
}
